package com.bjpowernode.money.mapper;

import com.bjpowernode.money.model.LoanInfo;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface LoanInfoMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(LoanInfo record);

    int insertSelective(LoanInfo record);

    LoanInfo selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(LoanInfo record);

    int updateByPrimaryKey(LoanInfo record);

    Double selectLoanRateAvg();

    List<LoanInfo> selectLoanProduct(HashMap<String, Object> paramsMap);

    Long selectLoanCountByType(Integer pType);

    int updateLeftProductMoneyForInvest(@Param("loanId") Integer loanId, @Param("bidMoney") Double bidMoney);

    // 带上version
    int updateLeftProductMoneyForInvest2(@Param("loanId")Integer loanId,  @Param("bidMoney")Double bidMoney,  @Param("version")int version);

    int selectVersionByPrimaryKey(Integer loanId);

    List<LoanInfo> selectLoanByFullStatus();
}